/************************************************************************/
// Copyright (C) 2016, han_gangbiao. All rights reserved.
// Use of this source code is governed by a GPL-v2 license that can be found in the License file.
// 
// [Time]:      2016-1-4 21:53:17
// [Author]:    han_gangbiao [http://my.oschina.net/jackhen]
// [Info]:      
/************************************************************************/

#include "xmutex.h"

BEG_NS_SMART

mutex_t::mutex_t()
{
    pthread_mutex_init(&m_mtx, NULL);
}

mutex_t::~mutex_t()
{
    pthread_mutex_destroy(&m_mtx);
}

void mutex_t::lock()
{
    pthread_mutex_lock(&m_mtx);
}

void mutex_t::unlock()
{
    pthread_mutex_unlock(&m_mtx);
}

END_NS_SMART
